<?php
/*
  功能：抽奖活动表 model
  作者：cxm
  时间：2019-10-23
*/

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class ActivityExtend extends BaseModel {
    use SoftDeletes;
    protected $dates = ['deleted_at']; //开启deleted_at
    protected $table='activity_extend';  //绑定表

    /**
     * 总抽奖次数
     * @param $activity_id 活动ID
     * @return mixed
     */
    public static function getTotalNum($activity_id){
        return self::where('activity_id',$activity_id)->value('total');
    }
}